home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / handyscrollingsample / handysample.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  4.0 KB  |  115 lines

  1. /*
  2.     File: HandySample.h
  3.     
  4.     Description:
  5.         This file contains constant declarations and exported routine prototypes
  6.     used in the HandySample application.
  7.  
  8.     Copyright:
  9.         © Copyright 2000 Apple Computer, Inc. All rights reserved.
  10.     
  11.     Disclaimer:
  12.         IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  13.         ("Apple") in consideration of your agreement to the following terms, and your
  14.         use, installation, modification or redistribution of this Apple software
  15.         constitutes acceptance of these terms.  If you do not agree with these terms,
  16.         please do not use, install, modify or redistribute this Apple software.
  17.  
  18.         In consideration of your agreement to abide by the following terms, and subject
  19.         to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  20.         copyrights in this original Apple software (the "Apple Software"), to use,
  21.         reproduce, modify and redistribute the Apple Software, with or without
  22.         modifications, in source and/or binary forms; provided that if you redistribute
  23.         the Apple Software in its entirety and without modifications, you must retain
  24.         this notice and the following text and disclaimers in all such redistributions of
  25.         the Apple Software.  Neither the name, trademarks, service marks or logos of
  26.         Apple Computer, Inc. may be used to endorse or promote products derived from the
  27.         Apple Software without specific prior written permission from Apple.  Except as
  28.         expressly stated in this notice, no other rights or licenses, express or implied,
  29.         are granted by Apple herein, including but not limited to any patent rights that
  30.         may be infringed by your derivative works or by other works in which the Apple
  31.         Software may be incorporated.
  32.  
  33.         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  34.         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  35.         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  36.         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  37.         COMBINATION WITH YOUR PRODUCTS.
  38.  
  39.         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  40.         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  41.         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  42.         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  43.         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  44.         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  45.         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  46.  
  47.     Change History (most recent first):
  48.         Tue, Feb 8, 2000 -- created
  49. */
  50.  
  51.  
  52. #ifndef __HandySample__
  53. #define __HandySample__
  54.  
  55. #define TARGET_API_MAC_CARBON 1
  56.  
  57. #include <Types.h>
  58. #include <Events.h>
  59.  
  60.  
  61.     /* the resource ID of the main menu bar list. */
  62. enum {
  63.     kMacOS9MenuBarID = 128
  64. };
  65.  
  66.     /* constants referring to the apple menu */
  67. enum {
  68.     mApple = 128,
  69.     iAbout = 1
  70. };
  71.  
  72.     /* constants referring to the file menu */
  73. enum {
  74.     mFile = 129,
  75.     iSlow = 1,
  76.     iQuit = 3
  77. };
  78.  
  79.     /* constants referring to the edit menu */
  80. enum {
  81.     mEdit = 130,
  82.     iUndo = 1,
  83.     iCut = 3,
  84.     iCopy = 4,
  85.     iPaste = 5,
  86.     iClear = 6
  87. };
  88.  
  89.     /* resource ID numbers for alerts that are called
  90.     to report different error conditions. */
  91. enum {
  92.     kAboutBoxAlertID = 128,
  93.     kErrorAlertID = 129
  94. };
  95.  
  96.     /* resource ID numbers for windows. */
  97. enum {
  98.     kHandyWindowOne = 129,
  99.     kHandyWindowTwo = 130
  100. };
  101.  
  102. /* ParamAlert is a general alert handling routine.  If Apple events exist, then it
  103.     calls AEInteractWithUser to ensure the application is in the forground, and then
  104.     it displays an alert after passing the s1 and s2 parameters to ParamText. */
  105. short ParamAlert(short alertID, StringPtr s1, StringPtr s2);
  106.  
  107.  
  108. /* HandleEvent is the main event handling routine for the
  109.     application.  ev points to an event record returned by
  110.     WaitNextEvent. */
  111. void HandleEvent(EventRecord *ev);
  112.  
  113.  
  114. #endif
  115.